{template 'header'}	

<div id="main">
        <div class="bread">
        <div class="fr">发布：{$editdate}</div>
        您当前的位置：<a href="{$MODULE[1][linkurl]}" title="{$AJ[sitename]}">{$AJ[sitename]}</a>&gt;<a href="{$MOD[linkurl]}">{$MOD[name]}</a>&gt;<span><a class="red" href="{$linkurl}">{$title}</a></span></div>
		<div class="detal cf">
			<div class="dtl_fl">
				<h1>{$title}</h1>
                                
				<div class="cf">
					<div class="dtl_flpic">
						<img src="{imgurl($thumb)}" id="bigp">
						<a href="javascript:" id="gol"></a>
						<a href="javascript:" id="gor"></a>
						<div class="dtl_pl">
							<ul id="dtl_pul">
                     
						     <!--{php $tags=tag("table=house_pic&condition=item=$itemid&pagesize=8&order=itemid desc&template=null");}-->
 {loop $tags $i $t}    
						  <li><img data-bigurl="{$t[thumb]}" class="on" src="{$t[thumb]}" alt="{$alt}"></li>{/loop}
                          
                       
                                                                        	
                                    							</ul>
						</div>
						<p> {if $fyts}
                                                                 <!--{php $ts=explode(",",$fyts);}-->
																 
     {loop $ts $ks $vs}
        <span class="ts" style="background:#{rand(0,255)};">{$vs}</span>
     {/loop}  
                                						</p>{/if}
					</div>
					<div class="dtl_frinfo">
						<table>
							<tr>
								<td colspan="2">售价：<span class="red">{if $price}<b>{$price}</b>万</span>({$danjia}元/平米){else}<b>面议</b></span>   {/if}                              	<a href="{$MODULE[1][linkurl]}tool" target="_blank" class="dtl_jsq">贷款计算器</a>
                                                                </td>
							</tr>
							<tr>
								<td width="210">面积：{$houseearm}平米</td>
								<td>户型：{if $room}{$room}室{/if}{if $hall}{$hall}厅{/if}{if $toilet}{$toilet}卫{/if}{if $balcony}{$balcony}阳台{/if}</td>
							</tr>
							<tr>
								<td>朝向：{getbox_diaoval('toward','checkbox',$toward,'sale_5')}</td>
								<td>楼层：第{$floor1}层/总{$floor2}层</td>
							</tr>
							<tr>
								<td>类型：{cat_pos($CAT, ' &raquo; ')}</td>
								<td>装修：{getbox_diaoval('fix','checkbox',$fix,'sale_5')}</td>
							</tr>
							<tr>
								<td>房龄：{$houseyear}年&nbsp;</td>
								

							</tr>
							<tr>
								<td colspan="2">小区：<a href="{$MODULE[18][linkurl]}{$houseid}/" target="_blank" title="{$housename}" class="bal">{$housename}</a></td>
							</tr>
							<tr>
								<td colspan="2">地址：{area_pos($areaid, ' ')} <font title="{$address}">{$address}</font>&nbsp;<a href="javascript:" class="bal" id="dtl_t_map" data-href="#dtl_map">(地图)</a> </td>
							</tr>
							<tr>
								<td colspan="2">交通： <font title="{$address}">{$bus}</font></td>
							</tr>
							<tr>
								<td colspan="2">房源特色：<font title="{$address}">{$fyts}</font></td>
							</tr>
						</table>
						<div class="dtl_mobile">
							<b>{$telephone}</b>
							来电咨询时，请说明是在{$AJ[sitename]}看到的。
                                                        {if $username}    <a data-housetype="1" data-touser="{$username}" data-info="{area_pos($areaid, ' ')},{$address},{if $room}{$room}室{/if}{if $hall}{$hall}厅{/if}{if $toilet}{$toilet}卫{/if},{$price}万元" data-val="{$itemid}" data-url="{$linkurl}" class="obtn" href="javascript:void(0)" id="alm1">预约看房</a>{/if}
                            						</div>
						<div class="dtl_ca">
							<form name="detailForm" id="detailForm" action="{$MODULE[2][linkurl]}favorite.php" method="post">
<input type="hidden" name="action" value="add"/>
<input type="hidden" name="title" value="{$title}"/>
<input type="hidden" name="url" value="{$linkurl}"/>
</form>
							<a href="javascript:document.getElementById('detailForm').submit();" class="favor">收藏</a>
							
							<a href="javascript:" id="shareBtn">分享<i></i></a>
							
							<div id="share_hide">
								<ul></ul>
								<span href="javascript:">分享<i></i></span>
							</div>
						</div>
					</div>
				</div>
				<h3 id="dtl_info">
					<a href="javascript:" data-href="#dtl_info" class="on">房源描述</a>
					{if $thumb}<a href="javascript:" data-href="#dtl_pic">房源图片</a> {/if}                       <a href="javascript:" data-href="#dtl_map">地图交通</a>
                        <a href="javascript:" data-href="#dtl_area">小区简介</a>
                    				</h3>
                                    <div class="dtl_tip">
                        <div class="dtl_fu">
                            <b>房源配套：</b>
		   <!--{php $ts=explode(",",$peitao);}-->
     {loop $ts $ks $vs}
      <span>{$vs}</span>
	  
     {/loop} </div> 
	  
                    </div>
                				<div class="dtl_content">
					{$content}		</div>
					{if $thumb}
                                    <h3 id="dtl_pic">
                        <a href="javascript:" data-href="#dtl_info">房源描述</a>
                        <a href="javascript:" data-href="#dtl_pic" class="on">房源图片</a>
                                                    <a href="javascript:" data-href="#dtl_map">地图交通</a>
                            <a href="javascript:" data-href="#dtl_area">小区简介</a>
                                            </h3>
                    <div class="dtl_pics">
                                                
												  <!--{php $tags=tag("table=house_pic&condition=item=$itemid&mid=5&pagesize=8&order=itemid desc&template=null");}-->
 {loop $tags $i $t}    
						  <img  src="{$t[thumb]}" alt="{$alt}"><br>{/loop}
			
                                                </div>{/if}
                                    <h3 id="dtl_map">
                        <a href="javascript:" data-href="#dtl_info" >房源描述</a>
                       	{if $thumb}<a href="javascript:" data-href="#dtl_pic">房源图片</a> {/if}                            <a href="javascript:" data-href="#dtl_map" class="on">地图交通</a>
                        <a href="javascript:" data-href="#dtl_area">小区简介</a>
                    </h3>
                    <div class="dtl_tip">
                        <p>小区地址：{$address}</p>
                        <p>公&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;交：{$bus}</p>
                    </div>
                                            <div class="dtl_maps cf">
                            <ul id="map_control">
                              
                                <li><a data-key="公交" href="javascript:"><i class="map_i2"></i>周边公交</a></li>
                                <li><a data-key="餐饮" href="javascript:"><i class="map_i3"></i>周边餐饮</a></li>
                                <li><a data-key="银行" href="javascript:"><i class="map_i4"></i>周边银行</a></li>
                                <li><a data-key="学校" href="javascript:"><i class="map_i5"></i>周边学校</a></li>
                                <li><a data-key="医院" href="javascript:"><i class="map_i6"></i>周边医院</a></li>
                                <li><a data-key="加油站" href="javascript:"><i class="map_i7"></i>周边加油站</a></li>
                            </ul>
                            <div id="map"></div>
                        </div>
                                        <h3 id="dtl_area">
                        <a href="javascript:" data-href="#dtl_info">房源描述</a>
                       	{if $thumb}<a href="javascript:" data-href="#dtl_pic">房源图片</a> {/if}                           <a href="javascript:" data-href="#dtl_map">地图交通</a>
                        <a href="javascript:" data-href="#dtl_area" class="on">小区简介</a>
                    </h3>
                    <div class="dtl_tip">
                        <table>
                            <tr>
                                <td>小区名称：{$housename}</td>
                                <td>项目类型：{search_cats($catid, '6')}</td>
                                <td>绿化率：{$lp_green}%</td>
                            </tr>
                            <tr>
                                <td>物&nbsp;&nbsp;业&nbsp;&nbsp;费：{$lp_costs}元/平方米·月</td>
                                <td colspan="2">物业公司：{$lp_company}</td>
                            </tr>
                            <tr>
                                <td colspan="3">开&nbsp;&nbsp;发&nbsp;&nbsp;商：{$kfs}</td>
                            </tr>
                        </table>
                    </div>
                    <div class="dtl_ainfo">
                        <h5><b>{$housename}本月均价：
                                                <span class="red">{get_avg_price($houseid)} 元/平米</span></b>
                                          该小区出售房源：<span><a class="blue" href="{$MODULE[18][linkurl]}{$houseid}/sale.html" target="_blank">{get_sale($houseid)} 套</a></span>该小区出租房源：<span><a class="blue" href="{$MODULE[18][linkurl]}{$houseid}/rent.htmll" target="_blank">{get_rent($houseid)} 套</a></span></h5>
                        <p>
                            <a href="javascript:" id="gz" class="dtl_gz">关注该小区</a>
                            <a href="{$MODULE[18][linkurl]}show.php?itemid={$houseid}" target="_blank" class="dtl_abtn">查看小区详细信息</a>
                           
                        </p>
                        <div class="dtl_aprice" id="ptab1">
                            <h4>
                                <span class="on">本小区价格走势</span>
                              
                            </h4>
                            <div id="hc1" class="dtl_aphc"></div>
                           
                        </div>
                    </div>
                                     
                      
                                        <h4 class="dtl_bh">
                        <a class="more" href="{$MODULE[18][linkurl]}{$houseid}/sale.html" target="_blank">更多</a>
                        <span>该小区其他二手房源</span>
                    </h4>
                    <ul class="cf dtl_pilist">
						<!--{php $tags=tag("moduleid=5&condition=status=3 and houseid=$houseid&areaid=$cityid&length=22&pagesize=5&order=hits desc&target=_blank&template=null");}-->
 {loop $tags $i $t}
                    	                            <li>
                              <a href="{$t[linkurl]}" target="_blank" title="{$t[alt]}"><img class="scrollLoading" data-src="{imgurl($t[thumb])}" title="{$t[alt]}" alt="{$t[alt]}" width="160" height="120"></a>
                                <span><a href="{$t[linkurl]}"   class="blue" target="_blank" title="{$t[alt]}">{$t[title]}</a></span>
                               {if $t[room]}{$t[room]}室{/if}{if $t[hall]}{$t[hall]}厅{/if}{if $t[toilet]}{$t[toilet]}卫{/if}{$t[houseearm]}平米<br>
                                <span class="red">{if $t[price]}{$t[price]}万元{else}面议{/if}</span>
                            </li>{/loop}
                                            </ul>
                			</div>
			<div class="dtl_fr">
				<DIV  id="contact">{template 'contactfs', 'chip'}</DIV>
            	       {if $username}
                                            <h3 class="dtl_rt">
                            该经纪人其他房源：
                        </h3>
                        <table class="h_rlist">
						   <!--{php $tags=tag("moduleid=$moduleid&length=20&condition=status=3  and username='$username'&pagesize=8&order=edittime desc&width=80&height=80&cols=8&template=null");}-->  
						      {loop $tags $k $t}           <tr>
                                        <td><span><a target="_blank" href="{$t[linkurl]}" title="{$t[title]}">{$t[housename]}</a></span></td>
                                        <td>&nbsp;{if $t[room]}{$t[room]}室{/if}{if $t[hall]}{$t[hall]}厅{/if}</td>
                                        <td>{$t[houseearm]}㎡</td>
                                        <td>&nbsp;<b class="red">{if $t[price]}{$t[price]}万</b>{else}面议</b>{/if}	</td>
                                    </tr>
                                            {/loop}
                                                
                                                    </table>
													{/if}
                                        <h3 class="dtl_rt">
                        可能感兴趣的房源：
                    </h3>
                    <ul class="dtl_pilist">  <!--{php $tags=tag("moduleid=$moduleid&condition=status=3  and level>0 and thumb!='' &areaid=$cityid&pagesize=5&order=addtime desc&target=_blank&template=null");}-->
   {loop $tags $k $t}
                                                    <li>
                                <a href="{$t[linkurl]}" target="_blank" title="{$t[alt]}"><img  src="{imgurl($t[thumb])}" title="{$t[alt]}" alt="{$t[alt]}" ></a>
                                <span><a href="{$t[linkurl]}"   class="blue" target="_blank" title="{$t[alt]}">{$t[title]}</a></span>
                                   {if $t[room]}{$t[room]}室{/if}{if $t[hall]}{$t[hall]}厅{/if}{if $t[toilet]}{$t[toilet]}卫{/if}{$t[houseearm]}平米<br>
                                <span class="red">{if $t[price]}{$t[price]}万元{else}面议{/if}</span>
                            </li>
                                              {/loop}
                                            </ul>
                			</div>
		</div>
	</div>
	
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=41ecef6e7501997ca9bc50e982577c82"></script>
<script>
seajs.use(["snail-baiduaround","highcharts","alert","config","alertlist","useryuyue","share","autab"],function(snail,hc,alertM,config,al,uyy){
	/*PPT*/
	var $dtl_pul = $("#dtl_pul").on("click","img",function(){
			$dtl_pul.find(".on").removeClass("on")
			$bigp.attr("src",$(this).addClass("on").attr("data-bigurl"))
		}),
		$bigp = $("#bigp"),
		pul=Math.ceil($dtl_pul.find("img").length/4),
		pui=0;
		$("#gor").on("click",function(){
			pui++;
			if(pui==pul)
				pui=0;
			$dtl_pul.animate({
				left:1-pui*385
			})
		})
		$("#gol").on("click",function(){
			pui--;
			if(pui<0)
				pui=pul-1;
			$dtl_pul.animate({
				left:1-pui*385
			})
		})
	$dtl_pul.find("img").eq(0).trigger("click");
	
	/*发送到手机*/
	$("#sendinfo").click(function(){
		al.sendHouse({
				name:"",
				info:"{area_pos($areaid, ' ')},{$address},{if $room}{$room}室{/if}{if $hall}{$hall}厅{/if}{if $toilet}{$toilet}卫{/if},{$danjia}元/平米,{$houseearm}平米,{$toward},电话：{$telephone}",
				hid:"{$itemid}",
				checkurl:"{$MODULE[2][linkurl]}sms.php",
				murl:"{$MODULE[2][linkurl]}sms.php"
		});
	})
	
	/*分享*/
	$("#share_hide").on("mouseleave",function(){
		$("#share_hide").hide()
	}).find("ul").share({text:""})
	$("#shareBtn").on("mouseenter",function(){
		$("#share_hide").show();
	})
	
	/*导航锚点*/
	var $hs=$("#dtl_info,#dtl_area,#dtl_map,#dtl_pic").on("click","a",function(e){
		var $h=$($(this).data("href"));
		$('html,body').animate({
			scrollTop: $h.offset().top
		},function(){
			$hs.removeClass("on")
			$h.addClass("on")
		})
		e.preventDefault()
	})
	$("#dtl_t_map").on("click",function(e){
		var $h=$($(this).data("href"));
		$('html,body').animate({
			scrollTop: $h.offset().top
		},function(){
			$hs.removeClass("on")
			$h.addClass("on")
		})
		e.preventDefault()
	})
	
	/*收藏*/
	$("#goFav").on("click",function(){
	// al.favorite("{$MODULE[3][linkurl]}shortcut.php?hid={$itemid}",{hid:"{$itemid}",type:"1",identity:'1',url:"{$MODULE[6][linkurl]}house.php?action=favorite"});
	
	});
	/*留言*/
	$("#l_message").on("click",function(){
		al.leaveMessage({
			uid:"{$userid}",
			uname:"{$truename}",
			truename:"{$_truename}",
			contact:"{$telephone}",
			url:"{$MODULE[2][linkurl]}message.php?action=send&touser={$username}"
		})
	});
	
			/*预约看房*/
		uyy({
			elm:"#alm1",
			type:"esf",
			sendurl:"",
			url:"{$MODULE[6][linkurl]}house.php?action=yuyue",
			fromuser:"{$_username}",
			truename:"{$_truename}",
			mobile:"{$_mobile}"
		})
				/*小区地图*/
		var laticoor = {$y};
	var longcoor = {$x};
			if(laticoor > 0 && longcoor > 0){
				snail.setURL("{$MOD[linkurl]}");
				snail.drawMap(parseFloat(longcoor),parseFloat(laticoor),"{$housename}","map");
				snail.getMaps();
			}
			var $ps=$('#map_control a').on("click",function(){
				snail.setKEY($(this).data("key"));
				if($(this).data("key") == 'house'){
					snail.setKEY("小区");
					snail.setH(true);
				}else{
					snail.setH(false);
				}
				$ps.removeClass("on");
				$(this).addClass("on");
				snail.getMaps();
			})
				
		
		/*各个价格走势*/
		hc('hc1',"{$housename}",[{get_linedate($houseid)}],[{get_lineprice($houseid)}],'元/平米');
		
		setTimeout(function(){
			$("#ptab1").autab("h4 span","div.dtl_aphc").find("span").eq(0).trigger("mouseenter");
		},999);
	});
</script>

{if $content}<script type="text/javascript" src="{AJ_STATIC}file/script/content.js"></script>{/if}
<script type="text/javascript">
	$("#esflist").attr("class","on");
</script>
{template 'footer'}